package co.edu.unal.model;

import java.awt.Graphics;
import java.awt.Point;

import co.edu.unal.util.BoundBox;

public abstract class ObjetoGrafico {
	public abstract void paint(Graphics g);

	public ObjetoGrafico(int x1, int y1, int x2, int y2, boolean normalize) {
		setBounds(x1, y1, x2, y2, normalize);
	}

	public void setBounds(int x1, int y1, int x2, int y2, boolean normalize) {
		bbox = new BoundBox(x1, y1, x2, y2, normalize);
	}

	public BoundBox getBounds() {
		return bbox;
	}

	public boolean isSelected() {
		return selected;
	}

	public void select(final Point ptPressed, final Point ptReleased) {
		if (ptPressed.equals(ptReleased)) {

			// point selection: selected = our bounding box contains the point
			System.out.println("iguales");

		} else {
			// bbox selection: selected = the bounding box [ptPressed,
			// ptReleased] contains our bounding box
		}
	}

	public void create(final Point ptPressed, final Point ptReleased) {
		

	}

	public boolean contain(final Point ptPressed, final Point ptReleased) {

		return contain;
	}

	private BoundBox bbox;
	private boolean selected;
	private boolean contain;
}
